﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace 静态字段
{
    class Program
    {
        static bool done;    // Static fields are shared between all threads

        static void Main()
        {
           var t= new Thread(Go);
            t.Name = "1111";
            t.Start();


            var t2 = new Thread(Go2);
            t.Name = "2222";
            t.Start();

            Console.ReadKey();
        }

        static void Go()
        {
            if (!done) { done = true; Console.WriteLine("Done"); }
        }

        static void Go2()
        {
            for (int i = 0; i < 100; i++)
            {
                Thread.Sleep(1000);
            }
        }
    }
}
